<?php
/* @var $this ThongtinsvController */
/* @var $model Thongtinsv */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'thongtinsv-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Điền đầy đủ vào vị trí có dấu <span class="required">*</span>.</p>

	<?php echo $form->errorSummary($model); ?>
<table>
	<div class="row">
	<tr>
		<td style='width:20%'><?php echo $form->labelEx($model,'makhoilop'); ?></td>
		<td><?php echo $form->textField($model,'makhoilop',array('size'=>6,'maxlength'=>6)); ?></td>
		<td><?php echo $form->error($model,'makhoilop'); ?></td>
	</tr>
	</div>

	<div class="row">
	<tr>
		<td><?php echo $form->labelEx($model,'thuockhoa'); ?></td>
		<td><?php
			$connection=Yii::app()->db;
				$commandDV=$connection->createCommand()
					->select('madonvi,tendonvi')
					->from('donvicongtac')
					->query();
					$khoa= array();
					foreach($commandDV as $rowDV)
					{
						//array_push($ngach,$row);
						if(substr( $rowDV['madonvi'],0,1)=='K')
						{
						$khoa[$rowDV['madonvi']]=$rowDV['tendonvi'];}
					}
		echo $form->dropDownList($model,'thuockhoa',$khoa); ?></td>
		<td><?php echo $form->error($model,'thuockhoa'); ?></td>
	</tr>
	</div>

	<div class="row">
	<tr>
		<td><?php echo $form->labelEx($model,'soluongsv'); ?></td>
		<td><?php echo $form->textField($model,'soluongsv'); ?></td>
		<td><?php echo $form->error($model,'soluongsv'); ?></td>
	</tr>
	</div>

	<div class="row">
	<tr>
		<td><?php echo $form->labelEx($model,'trinhdo'); ?></td>
		<td><?php echo $form->dropDownList($model,'trinhdo',array('ĐH'=>'Đại học','CĐ'=>'Cao đẳng')); ?></td>
		<td><?php echo $form->error($model,'trinhdo'); ?></td>
	</tr>
	</div>

	<div class="row">
	<tr>
		<td><?php echo $form->labelEx($model,'namvaotruong'); ?></td>
		<td><?php
			$now=getdate();
			$year=array();
			for($i=$now['year']-7;$i<=$now['year'];$i++)
				$year[$i]=$i;
		echo $form->dropDownList($model,'namvaotruong',$year); ?></td>
		<td><?php echo $form->error($model,'namvaotruong'); ?></td>
	</tr>
	</div>
</table>
	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Tạo mới' : 'Lưu'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->